//
//  CC_Find_ViewController.m
//  HimalayaMountain
//
//  Created by dllo on 16/7/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CC_Find_ViewController.h"
#import "CC_Basic_View.h"
#import "CC_Find_NaviModel.h"

@interface CC_Find_ViewController ()

@property(nonatomic, retain)CC_Basic_View *basicView;
@property(nonatomic, retain)NSMutableArray *listArray;


@end

@implementation CC_Find_ViewController

- (void)dealloc
{
    [_listArray release];
    [_basicView release];
    [super dealloc];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = AUTOCOLOR;
    self.listArray = [NSMutableArray array];
    
    [self handleData];
    
    
    
    [self createBasicView];
}

-(void)handleData{
    
    [CCNetTool GET:@"http://mobile.ximalaya.com/mobile/discovery/v1/tabs?device=iPhone" body:nil headerFile:nil response:CCJSON success:^(id result) {

        NSDictionary *dic = result;
        NSArray *listArray = [[dic objectForKey:@"tabs"] objectForKey:@"list"];

        self.basicView.arrayOfTitle = [CC_Find_NaviModel arrayFromArray:listArray];
        NSLog(@"%@", self.basicView.arrayOfTitle);
        
        
    } failure:^(NSError *error) {
     
    }];
    
    
}






-(void)createBasicView{
    
    self.basicView = [[CC_Basic_View alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT - 64 - 49)];
    
    [self.view addSubview:_basicView];
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
